/*
 * CommunicationMan.h
 *
 *  Created on: Apr 2, 2011
 *      Author: Anton
 */

#ifndef COMMUNICATIONMAN_H_
#define COMMUNICATIONMAN_H_

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <iostream>
#include "Robot.h"
#include "Leg.h"
#include "Link.h"

using std::endl;
using std::cout;
using std::cin;

class CommunicationMan {
public:
	CommunicationMan(Robot* ST, char* ip, int port);
   	Robot* rbe;
   	Robot* getRobot(){ return rbe; }
	virtual ~CommunicationMan();
	void sendString(const char *buf);
	void sendAngles();
private:
	int sock;
	struct sockaddr_in server_addr;
	struct hostent *host;
	char send_data[1024];

};

#endif /* COMMUNICATIONMAN_H_ */
